package com.yanqu.road.entity.activity.springdinner;

import com.yanqu.road.entity.DataObject;

import java.math.BigInteger;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class SpringDinnerUserData extends DataObject {

    private int activityId;

    private long userId;

    private BigInteger integral = BigInteger.ZERO;

    // 单局积分当前积分
    private Map<Integer, BigInteger> currentIntegralMap = new ConcurrentHashMap<>();

    private int hp;

    private long hpTime;

    //走第几步了 三种场次
    private Map<Integer,Integer> stepMap = new ConcurrentHashMap();

    //生成了多少球了 三种场次
    private Map<Integer,Integer> ballCountMap = new ConcurrentHashMap();

    //下一个球是什么
    private Map<Integer,BallData> nextBallMap = new ConcurrentHashMap();

    //场次123 no 球
    private Map<Integer, Map<Integer,BallData>> ballMap = new ConcurrentHashMap();
    //场次123 id 个数
    private Map<Integer, Map<Integer,Integer>> mergeMap = new ConcurrentHashMap();

    //第几场了
    private Map<Integer,Integer> gameNoMap = new ConcurrentHashMap();
    //消除次数
    private Map<Integer,Integer> clearMap = new ConcurrentHashMap();
    //积分大小
    private Map<Integer,Long> integralMap = new ConcurrentHashMap();

    // 游戏状态
    private Map<Integer, Boolean> gameStatusMap = new ConcurrentHashMap();

    private long updateTime;

    // 是否发过提醒
    private boolean hasMeiTuanNotice = false;

    // 今日分享次数
    private int shareCount;

    // 分享次数重置时间
    private long shareResetTime;

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        this.activityId = activityId;
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public BigInteger getIntegral() {
        return integral;
    }

    public void setIntegral(BigInteger integral) {
        if(integral.compareTo(this.integral) != 0){
            this.integral = integral;
            setUpdateOption();
        }
    }

    public int getHp() {
        return hp;
    }

    public void setHp(int hp) {
        if(hp != this.hp){
            this.hp = hp;
            setUpdateOption();
        }
    }

    public long getHpTime() {
        return hpTime;
    }

    public void setHpTime(long hpTime) {
        if(hpTime != this.hpTime){
            this.hpTime = hpTime;
            setUpdateOption();
        }
    }

    public Integer getBallCount(int type) {
        return ballCountMap.get(type);
    }

    public Map<Integer, Integer> getBallCountMap() {
        return ballCountMap;
    }

    public void setBallCountMap(Map<Integer, Integer> ballCountMap) {
        this.ballCountMap = ballCountMap;
        setUpdateOption();
    }

    public Map<Integer, Map<Integer, BallData>> getBallMap() {
        return ballMap;
    }

    public void setBallMap(Map<Integer, Map<Integer, BallData>> ballMap) {
        this.ballMap = ballMap;
        setUpdateOption();
    }

    public long getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(long updateTime) {
        if(updateTime != this.updateTime){
            this.updateTime = updateTime;
            setUpdateOption();
        }
    }

    public BallData getNextBall(int type) {
        return nextBallMap.get(type);
    }

    public Map<Integer, BallData> getNextBallMap() {
        return nextBallMap;
    }

    public void setNextBallMap(Map<Integer, BallData> nextBallMap) {
        this.nextBallMap = nextBallMap;
        setUpdateOption();
    }

    public Map<Integer, Integer> getStepMap() {
        return stepMap;
    }

    public void setStepMap(Map<Integer, Integer> stepMap) {
        this.stepMap = stepMap;
        setUpdateOption();
    }

    public Map<Integer, Map<Integer, Integer>> getMergeMap() {
        return mergeMap;
    }

    public void setMergeMap(Map<Integer, Map<Integer, Integer>> mergeMap) {
        this.mergeMap = mergeMap;
        setUpdateOption();
    }

    public Map<Integer, Integer> getGameNoMap() {
        return gameNoMap;
    }

    public void setGameNoMap(Map<Integer, Integer> gameNoMap) {
        this.gameNoMap = gameNoMap;
        setUpdateOption();
    }

    public Map<Integer, Integer> getClearMap() {
        return clearMap;
    }

    public void setClearMap(Map<Integer, Integer> clearMap) {
        this.clearMap = clearMap;
        setUpdateOption();
    }

    public Map<Integer, Long> getIntegralMap() {
        return integralMap;
    }

    public void setIntegralMap(Map<Integer, Long> integralMap) {
        this.integralMap = integralMap;
        setUpdateOption();
    }

    public boolean isHasMeiTuanNotice() {
        return hasMeiTuanNotice;
    }

    public void setHasMeiTuanNotice(boolean hasMeiTuanNotice) {
        if(hasMeiTuanNotice != this.hasMeiTuanNotice){
            this.hasMeiTuanNotice = hasMeiTuanNotice;
            setUpdateOption();
        }
    }

    public int getShareCount() {
        return shareCount;
    }

    public void setShareCount(int shareCount) {
        if(shareCount != this.shareCount){
            this.shareCount = shareCount;
            setUpdateOption();
        }
    }

    public long getShareResetTime() {
        return shareResetTime;
    }

    public void setShareResetTime(long shareResetTime) {
        if(shareResetTime != this.shareResetTime){
            this.shareResetTime = shareResetTime;
            setUpdateOption();
        }
    }

    public Map<Integer, BigInteger> getCurrentIntegralMap() {
        return currentIntegralMap;
    }

    public void setCurrentIntegralMap(Map<Integer, BigInteger> currentIntegralMap) {
        if (currentIntegralMap == null) {
            return;
        }
        this.currentIntegralMap = currentIntegralMap;
        setUpdateOption();
    }

    public Map<Integer, Boolean> getGameStatusMap() {
        return gameStatusMap;
    }

    public void setGameStatusMap(Map<Integer, Boolean> gameStatusMap) {
        if (gameStatusMap == null) {
            return;
        }
        this.gameStatusMap = gameStatusMap;
        setUpdateOption();
    }
}
